﻿namespace nhappend.Common
{
    using System;
    using System.IO;

    public static class ConfigFileFinder
    {
        public static string GetConfigFilePath(string file)
        {
            string basePath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            string path = Path.Combine(basePath, file);

            return !File.Exists(path) ? AppDomain.CurrentDomain.SetupInformation.ConfigurationFile : path;
        }
    }
}